/*
 * 菜单
 *
 * @Author:    1024创新实验室-主任：卓大
 * @Date:      2022-09-03 22:00:32
 * @Wechat:    zhuda1024
 * @Email:     lab1024@163.com
 * @Copyright  1024创新实验室 （ https://1024lab.net ），Since 2012
 */
import { getRequest, postRequest, putRequest, deleteRequest } from '/src/lib/axios';

const baseUrl = "/api/sys/user"

export const api = {
  /**
   * 添加菜单
   */
  add: (param) => {
    return postRequest({
      url: baseUrl,
      data: param
    });
  },

  /**
   * 更新菜单
   */
  update: (param) => {
    return putRequest({
      url: baseUrl,
      data: param
    });
  },

  delete: (id) => {
    return deleteRequest({
      url: baseUrl + "/" + id
    });
  },

  queryPage: (param) => {
    return getRequest({
      url: baseUrl + '/page',
      params: param
    });
  },

  getInfo: (name) => {
    return getRequest({
      url: baseUrl + '/info/' + name
    });
  },


  /**
   * 修改密码
   */
  resetPassword: (param) => {
    return putRequest({
      url: baseUrl + "/reset-password",
      data: param
    });
  },

};
